package com.junlong.controller;

import com.junlong.po.Account;
import com.junlong.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * @program: SpringSSM
 * @description:
 * @author: qinjianbao
 * @create: 2020-12-22 09:37
 */
@Controller
public class AccountController {

    //注入service层
    @Autowired(required = false)
    private AccountService accountService;
    @RequestMapping(value = "findAll",method = RequestMethod.GET)
    public String findAll(Model model){
        List<Account> lists = accountService.findAll();
        model.addAttribute("accounts",lists);

        return "findAccount";

    }

}
